package com.li.general.buttons
{
import flash.events.MouseEvent;
import flash.text.TextField;

public class DLabelColorChangeBtn extends Button
{
    // Declared in Flash.
    public var label:TextField;

    private var _overColor:uint;
    private var _outColor:uint;

    public function DLabelColorChangeBtn(text:String, overColor:uint, outColor:uint)
    {
        super();

        _overColor = overColor;
        _outColor = outColor;

        label.text = text;
        label.width = label.textWidth + 5;
        label.selectable = false;
        hit.width = label.width;
        colorBtn(_outColor);
    }

    private function colorBtn(color:uint):void
    {
        label.textColor = color;
    }

    override protected function hitMouseOverHandler(evt:MouseEvent):void
    {
        colorBtn(_overColor);
    }

    override protected function hitMouseOutHandler(evt:MouseEvent):void
    {
        colorBtn(_outColor);
    }
}
}